﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LogicTree
{
    public class Disjunction<T>
    {
        public List<Conjunction<T>> Conjunctions = new List<Conjunction<T>>();
        public override string ToString()
        {
            string statement = "";
            if(Conjunctions.Count > 0)
            {
                if (Conjunctions.Count > 1)
                    statement = "(";

                statement += Conjunctions[0].ToString();
            }
            for (int i = 1; i < Conjunctions.Count; i++)
            {
                 statement += ") | (" + Conjunctions[i].ToString() + ")";
            }

            return statement;
        }
    }
}
